import fetch from 'utils/fetch';
/**
 * 版本管理
 */
//获取所有当前App版本信息，包括版本总个数
export function getAllAppList() {
    return fetch({
        url: 'sysApp/getAllAppList/',
        method: 'get',
    });
  }
//根据Source 获取App历史版本信息
export function getOldVersionInfoBySource(sSource) {
    return fetch({
        url: 'sysApp/getOldVersionInfoBySource/'+sSource,
        method: 'get',
    });
  }
  //获取所有App种类和相应App名称
export function getAppTypeList() {
    return fetch({
        url: 'sysApp/getAppTypeList/',
        method: 'get',
    });
  }
  //根据ID获取App版本详细信息
export function getAppVersionDetail(pId) {
    const data = {
        pId
    };
    return fetch({
        url: 'sysApp/getAppVersionDetail',
        method: 'post',
        data
    });
  }
  //更新App版本信息
export function updateAppVersion(sVersion,sMinVersion,pId,sDesc,sOnLineTime) {
    const data = {
        sVersion,
        sMinVersion,
        pId,
        sDesc,
        sOnLineTime
    };
    return fetch({
        url: 'sysApp/updateAppVersion/',
        method: 'post',
        data
    });
  }
  //删除App版本信息 
export function deleteAppVersion(pId) {
    const data = {
        pId
    };
    return fetch({
        url: 'sysApp/deleteAppVersion',
        method: 'post',
        data
    });
  }
  //添加App版本信息
export function addAppVersion(sVersion,sMinVersion,sOnLineTime,sDesc,sSource) {
    const data = {
        sVersion,
        sMinVersion,
        sOnLineTime,
        sDesc,
        sSource
    };
    return fetch({
        url: 'sysApp/addAppVersion',
        method: 'post',
        data
    });
  }

//发布App版本
export function publishAppVersion(pId) {
    const data = {
        pId
    };
    return fetch({
        url: '/sysApp/publishAppVersion',
        method: 'post',
        data
    });
  }